﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfWordsLearner.Views
{
	/// <summary>
	/// Interaction logic for ResultView.xaml
	/// </summary>
	public partial class ResultView : Window
	{
		public ResultView()
		{
			InitializeComponent();
		}

		private void MenuItem_Click(object sender, RoutedEventArgs e)
		{
			var vm = (App.Current.MainWindow.DataContext as ViewModels.Windows1ViewModel);
			if(vm!=null)
			{
				if(dgrResults.SelectedItem!=null)
				{
					foreach (var item in vm.Words.Where(x => string.Compare(x.EnglishWord.Trim(), 
														(dgrResults.SelectedItem as Model.TestWordModel).Word.EnglishWord.Trim(), true) == 0))
						item.IsComplicated = true;
				}
			}
		}
	}
}
